package aishua.com.mytestapplist.diyiview;

import android.content.Context;
import android.util.AttributeSet;
import android.webkit.WebView;

/**
 * Created by aishua on 2018/3/26.
 */

public class MyWebview extends WebView {

    public MyWebview(Context context) {
        super(context);
    }

    public MyWebview(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyWebview(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        scrollChangedListener.onScroll(l, t, oldl, oldt);
    }
    public ScrollChangedListener scrollChangedListener;
    public void setScrollChangedListener(ScrollChangedListener scrollChangedListener){
        this.scrollChangedListener =scrollChangedListener;
    }
    public interface  ScrollChangedListener{
         public void onScroll(int l, int t, int oldl, int oldt);
    }
}
